import java.util.*;
//QR6 字符串替换
class StringFormat {
    public String formatString(String A, int n, char[] arg, int m) {
        int flag = 0;
        int k = 0;
        int sNum = 0;
        StringBuilder ans = new StringBuilder();

        int j = 0;
        while (j < n) {
            flag = A.indexOf("%s", j);
            if (flag != -1) {
                sNum++;
            } else {
                break;
            }
            j = flag + 1;
        }
        if (sNum > m) {
            return "";
        }
        for (int i = 0; i < n; i++) {
            char c = A.charAt(i);
            int index = A.indexOf("%s", i);
            if (i == index && k < arg.length) {
                ans.append(arg[k++]);
                i++;
                continue;
            }
            ans.append(c);
        }
        while(k<m){
            ans.append(arg[k++]);
        }
        return ans.toString();

    }
}




//神奇数
 class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();

        int ans = 0;
        for (int i = a; i <= b; i++) {
            if (i < 10) {
                continue;
            }
            if (func(i)) {
                ans++;
            }
        }
        System.out.print(ans);
    }
    public static boolean isPrime(int x) {
        if (x < 2) return false;
        if (x == 2 || x == 3) return true;
        if (x % 2 == 0 || x % 3 == 0) return false;

        for (int i = 5; i * i <= x; i += 6) {
            if (x % i == 0 || x % (i + 2) == 0) return false;
        }
        return true;
    }
    public static boolean func(int x) {
        String s = String.valueOf(x);
        for (int i = 0; i < s.length(); i++) {
            for (int j = 0; j < s.length(); j++) {
                int num = 0;
                if (i == j) {
                    continue;
                }
                int a = s.charAt(i) - '0';
                int b = s.charAt(j) - '0';
                if (a == 0) {
                    continue;
                }
                num = a * 10 + b;
                if (isPrime(num)) {
                    return true;
                }
            }
        }
        return false;
    }

}




// DNA序列
 class Main2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        char[] s = in.next().toCharArray();
        int x = in.nextInt();

        int begin = 0; // 标记结果的起始位置
        int maxCount = 0; // 统计以前窗内C + G的最大值
        int left = 0, right = 0, n = s.length;
        int count = 0; // 统计窗口内C + G

        while (right < n) {
            // 如果当前字符是C或者G，增加count
            if (s[right] == 'C' || s[right] == 'G') {
                count++;
            }

            // 如果窗口大小超过了x，缩小窗口，左指针右移
            if (right - left + 1 > x) {
                if (s[left] == 'C' || s[left] == 'G') {
                    count--;
                }
                left++;
            }

            // 当窗口大小正好为x时，更新最大值
            if (right - left + 1 == x) {
                if (count > maxCount) {
                    begin = left;
                    maxCount = count;
                }
            }

            // 右指针向右移动
            right++;
        }

        // 输出结果
        for (int i = begin; i < begin + x; i++) {
            System.out.print(s[i]);
        }
    }
}
